﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using CSharp.Libs.ExceptionHandling;
using CSharp.Libs.Koc;
using KocMapView;

namespace KocAllianceLister
{
    /// <summary>
    /// Interaktionslogik für AllianceComparer.xaml
    /// </summary>
    public partial class AllianceComparer : Window
    {
        private AllianceComparerViewModel _ACVM = null;
        private wndKocMapView _KMV=null;

        public AllianceComparer(
            ExceptionCollector EC,
            URLHolder UH,
            Boolean ExecuteViewCourt)
        {
            InitializeComponent();

            _ACVM = new AllianceComparerViewModel(EC, UH, ExecuteViewCourt);
            DataContext = _ACVM;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
             Cursor = Cursors.Wait;

            _ACVM.ExecuteURLs();

            _KMV = new wndKocMapView();
            KocMapViewViewModel KMVVM=_KMV.DataContext as KocMapViewViewModel;
            if(KMVVM != null)
            {
                KMVVM.ShowCoords(_ACVM.KoordItems);
            }
            
            _KMV.ShowDialog();
            
            Cursor = Cursors.Arrow;
        }
    }
}
